<%= page_title "Kubernetes Clusters" %>

<section class="clearfix tabs">
  <div class="table table-hover table-condensed">

    <table class="table">
      <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Deploy Groups</th>
        <th>Actions</th>
      </tr>

      <% @clusters.each do |cluster| %>
        <tr>
          <td><%= link_to cluster.name, cluster %></td>
          <td><%= cluster.description %></td>
          <td>
            <%= render 'deploy_group_list', deploy_groups: cluster.deploy_groups %>
            <%= render 'capacity', cluster: cluster if params[:capacity] %>
          </td>
          <td><%= link_to "Edit", edit_kubernetes_cluster_path(cluster) %></td>
        </tr>
      <% end %>
    </table>
  </div>

  <div class="admin-actions">
    <div class="pull-right">
      <%= link_to "Capacity", "?capacity=1" unless params[:capacity] %>
      <%= link_to "New", new_kubernetes_cluster_path, class: "btn btn-default" %>
      <% if ENV["GCLOUD_GKE_CLUSTERS_FOLDER"] %>
        <%= link_to "New GKE", new_gke_cluster_path, class: "btn btn-default" %>
      <% end %>
    </div>
  </div>
</section>
